Optimal. Leaf size=83 \[ \frac{2 a \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (e+f x)\right )+b}{\sqrt{a^2-b^2}}\right )}{f \left (a^2-b^2\right )^{3/2}}+\frac{b \cos (e+f x)}{f \left (a^2-b^2\right ) (a+b \sin (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0595759, antiderivative size = 83, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.417, Rules used = {2664, 12, 2660, 618, 204} \[ \frac{2 a \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (e+f x)\right )+b}{\sqrt{a^2-b^2}}\right )}{f \left (a^2-b^2\right )^{3/2}}+\frac{b \cos (e+f x)}{f \left (a^2-b^2\right ) (a+b \sin (e+f x))} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2664
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{1}{(a+b \sin (e+f x))^2} \, dx &=\frac{b \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}-\frac{\int \frac{a}{a+b \sin (e+f x)} \, dx}{-a^2+b^2}\\ &=\frac{b \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac{a \int \frac{1}{a+b \sin (e+f x)} \, dx}{a^2-b^2}\\ &=\frac{b \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}+\frac{(2 a) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f}\\ &=\frac{b \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}-\frac{(4 a) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (e+f x)\right )\right )}{\left (a^2-b^2\right ) f}\\ &=\frac{2 a \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2} f}+\frac{b \cos (e+f x)}{\left (a^2-b^2\right ) f (a+b \sin (e+f x))}\\ \end{align*}
Mathematica [A] time = 0.183385, size = 82, normalized size = 0.99 \[ \frac{\frac{2 a \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (e+f x)\right )+b}{\sqrt{a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac{b \cos (e+f x)}{(a-b) (a+b) (a+b \sin (e+f x))}}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.056, size = 155, normalized size = 1.9 \begin{align*} 2\,{\frac{{b}^{2}\tan \left ( 1/2\,fx+e/2 \right ) }{f \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}a+2\,\tan \left ( 1/2\,fx+e/2 \right ) b+a \right ) a \left ({a}^{2}-{b}^{2} \right ) }}+2\,{\frac{b}{f \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}a+2\,\tan \left ( 1/2\,fx+e/2 \right ) b+a \right ) \left ({a}^{2}-{b}^{2} \right ) }}+2\,{\frac{a}{f \left ({a}^{2}-{b}^{2} \right ) ^{3/2}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( 1/2\,fx+e/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.77273, size = 752, normalized size = 9.06 \begin{align*} \left [\frac{{\left (a b \sin \left (f x + e\right ) + a^{2}\right )} \sqrt{-a^{2} + b^{2}} \log \left (-\frac{{\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2} - 2 \,{\left (a \cos \left (f x + e\right ) \sin \left (f x + e\right ) + b \cos \left (f x + e\right )\right )} \sqrt{-a^{2} + b^{2}}}{b^{2} \cos \left (f x + e\right )^{2} - 2 \, a b \sin \left (f x + e\right ) - a^{2} - b^{2}}\right ) + 2 \,{\left (a^{2} b - b^{3}\right )} \cos \left (f x + e\right )}{2 \,{\left ({\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) +{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f\right )}}, -\frac{{\left (a b \sin \left (f x + e\right ) + a^{2}\right )} \sqrt{a^{2} - b^{2}} \arctan \left (-\frac{a \sin \left (f x + e\right ) + b}{\sqrt{a^{2} - b^{2}} \cos \left (f x + e\right )}\right ) -{\left (a^{2} b - b^{3}\right )} \cos \left (f x + e\right )}{{\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f \sin \left (f x + e\right ) +{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37075, size = 171, normalized size = 2.06 \begin{align*} \frac{2 \,{\left (\frac{{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (a\right ) + \arctan \left (\frac{a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + b}{\sqrt{a^{2} - b^{2}}}\right )\right )} a}{{\left (a^{2} - b^{2}\right )}^{\frac{3}{2}}} + \frac{b^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a b}{{\left (a^{3} - a b^{2}\right )}{\left (a \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 2 \, b \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + a\right )}}\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]